
function doCreateWand(cid, var, _table)
	local rightHand, leftHand = getPlayerSlotItem(cid, 5), getPlayerSlotItem(cid, 6)
	local transformItem = nil
	local ingredientItem = nil
	local TABLE = nil
	
	if rightHand.itemid == 7426 then
		transformItem = rightHand
		ingredientItem = leftHand
	elseif leftHand.itemid == 7426 then
		transformItem = leftHand
		ingredientItem = rightHand
	else
		doPlayerSendCancel(cid, "You don't have a stick.")
		return false
	end

	TABLE = _table[ingredientItem.itemid] or nil
	if TABLE == nil then
		doPlayerSendCancel(cid, "You need a magic item to cast this spell.")
		return false
	end
	doRemoveItem(ingredientItem.uid)
	doTransformItem(transformItem.uid, TABLE.id)
	doSendMagicEffect(getCreaturePosition(cid), TABLE.effect)
	return true
end